﻿using System;
using System.Diagnostics;
using Smarly.Idml.RelaxNg.Generator.Model;
using Tenuto.Grammar;

namespace Smarly.Idml.RelaxNg.Generator.Proxy
{
	public class GroupExpBuilder : Builder<GroupExp>
	{
		[DebuggerStepThrough]
		protected internal GroupExpBuilder(GroupExp exp, Action<IObjectName> updateName) : base(exp, updateName) { }

		public override IStruct CreateIStruct()
		{
			//todo correct
			return null;
		}

		public override IStruct Fill(IStruct getStruct = null)
		{
			getStruct = base.Fill(getStruct);

			foreach (Expression expression in Exp.children)
			{
				Factory(expression, UpdateName).Fill(getStruct);
			}

			return getStruct;
		}
	}
}